<?php slot('header')?>
<script type="text/javascript">
function faq(data){
	FORM.faq(data);
}
$(function(){
	MAIN.setMenu('faq');
	FORM.init();
});
</script>
<?php end_slot()?>
<main>
	<aside class="left">
		<nav class="content">
			<a href="<?php echo url_for2('faq')?>"><h1>Câu hỏi thường gặp</h1></a>
			<div class="clr"></div>
		</nav>
		<div>
				<?php 
				$clear = '';
				foreach ($data['faqs'] as $fa):
				echo $clear;
				?>
				<article class="faq-item">
					<h1><?php echo html_entity_decode($fa['question'])?></h1>
					
					<div class="content">
						<?php echo html_entity_decode(($fa['answer']))?>
					</div>
					
				</article>
				
				<?php 
				$clear = '<div class="line"></div>';
				endforeach;?>
				<div class="clr"></div>
				<?php include_component('componentUlti', 'pagination',$data['pagination']);?>
		</div>
	</aside>
	<aside class="right">
		<div class="bar-title">
			<h1 class="right">Gửi câu hỏi</h1>
		</div>
		<?php include_component('componentUlti', 'error')?>
		<form action="<?php url_for('faq_question')?>" method="post" id="form_faq">
			<label for="faq_email">Email của bạn</label><br/>
			<input type="email" class="hz-required hz-email" placeholder="vd: <?php echo sfConfig::get('app_contact_mail')?>" id="faq_email" name="faq_email"/><br/>
			
			<label for="faq_question">Nội dung cần hỏi</label><br/>
			<textarea name="faq_question" id="faq_question" class="faq hz-required" placeholder="vd: Nội dung cần hỏi"></textarea><br/>
			
			<label for="faq_captcha">Mã bảo vệ</label><br/>
			<input type="text" maxlength="6" placeholder="nhập ký tự hình bên" class="number hz-required captcha" name="faq_captcha" id="faq_captcha"/>  <img class="captcha" />
			<div class="clr"></div>
			<a href="#" callback-after-success="faq" data-form-id="form_faq" class="button right hz-submit-ajax " data-url="<?php echo url_for2('faq_question')?>">Gửi câu hỏi</a>
		</form>
		<div class="clr"></div>
		<br/>
		<div class="line"></div>
		<div class="bar-title">
		<h1 class="right">Bài viết quan trọng</h1>
	</div>
	<?php 
		$clear = '';
		foreach($data['news'] as $news):
		$url = url_for2('news_detail', array('id' => $news['id'], 'cate_id' => $news['cate_id'], 'title' => UserStringHelper::titleToAddress($news['title'])));
		echo $clear;
		?>
		<article class="news-item">
			<a title="<?php echo $news['title']?>" alt="<?php echo $news['title']?>" href="<?php echo $url?>"><h1><?php echo $news['title']?></h1></a>
			<?php if (!empty($news['photo_url'])):?><div class="thumb"><a title="<?php echo $news['title']?>" alt="<?php echo $news['title']?>" href="<?php echo $url?>"><img src="<?php echo $news['photo_url']?>" title="<?php echo $news['title']?>" alt="<?php echo $news['title']?>"/></a></div><?php endif;?>
			<div class="des">
				<?php echo html_entity_decode($news['description'])?>
			</div>
			<a class="button right" title="<?php echo $news['title']?>" alt="<?php echo $news['title']?>" href="<?php echo $url?>">Xem thêm</a>
		</article>
		<div class="clr"></div>
		
		<?php
		
		$clear = '<div class="line"></div>';
		endforeach?>
		<div class="clr"></div>
	</aside>
	<div class="clr"></div>
	
</main>